<% include ../pageHeader %>
<%
    var strPageLinks = helper.generatePageLinks(intEntryCount, intEntryPerPage, intCurrentPage, 15, strURLPrefix);
%>
<div id="mainWrapper">
    <div id="content" class="content">
        <div id="innerContent">
            <div class="comment-wrapper">
                <div class="article-top">
                    <div class="pages">
                        <%= __('comments') %> |
                        <% if(intCategory){ %>
                        <%= __('category') %>: <%= helper.HTMLEncode(theCache.getCategoryByID(intCategory).name) %> |
                        <% } %>
                        <% if(input["q"]){ %>
                        <%= __('search') %>: <%= helper.HTMLEncodeLite(input["q"]) %> |
                        <% } %>
                        <%= strPageLinks %>
                    </div>
                </div>
                <%
                if(intEntryCount == 0){
                %>
                <div class="no-entry">
                    <div class="no-entry-message">
                        <%= lang["no-entry"] %>
                    </div>
                </div>
                <%
                }else{
                for(var i = 0;i < comments.length;i++){
                        with(comments[i]){
                %>
                <div class="commentbox">
                    <div class="commentbox-title">
                        <img src="<%= theCache.settings["imageFolder"] %>/icon_quote<% if(authorID ==
                                log_authorID)write("_author") %>.gif" alt="<%= __('quote') %>"/>
                        <b><a href="user.asp?act=view&amp;id=<%= authorID %>"><%= author %>
                                <% if(authorID == 0)write("*") %>
                            </a></b>
                        :
                        <a href="article.asp?id=<%= log_id %>"><%= log_title %></a>
                        <div class="commentbox-label">
                            [ <%= helper.getDateTimeString("YY-MM-DD hh:ii:ss", postTime) %>
                            <% if(theUser.groupID == 1){ %>
                            | <%= IP %>
                            <% } %>
                            ]
                            <% if(theUser.loggedIn && (theUser.rights["edit"] > 1 || (theUser.rights["edit"] == 1 &&
                                    (theUser.id == log_authorID || theUser.id == authorID)))){ %>
                            &nbsp;<a href="comment.asp?act=edit&amp;id=<%= id %>" title="<%= lang['edit'] %>"><img
                                        src="<%= theCache.settings["imageFolder"] %>/icon_edit.gif"
                                        alt="<%= lang['edit'] %>"></a>
                            <% } %>
                            <% if(theUser.loggedIn && (theUser.rights["delete"] > 1 || (theUser.rights["delete"] == 1 &&
                                    (theUser.id == log_authorID || theUser.id == authorID)))){ %>
                            &nbsp;<a href="comment.asp?act=delete&amp;id=<%= id %>" title="<%= lang['delete'] %>"
                                     onclick="return confirm('<%= __('confirm_delete_comment') %>?')"><img
                                        src="<%= theCache.settings["imageFolder"] %>/icon_del.gif"
                                        alt="<%= lang['delete'] %>"></a>
                            <% } %>
                        </div>
                    </div>
                    <div id="comm_<%= id %>" class="commentbox-content">
                        <% if(!hidden || theUser.id == log_authorID || (theUser.id == authorID && authorID != 0)){ %>
                            <%
                                var strContent = ubb.toHTML(helper.HTMLEncode(content), ubbFlags, "", true)
                                if (arrKeywords.length > 0) {
                                    strContent = helper.highlight(strContent, arrKeywords);
                                }
                            %>
                            <%= strContent %>
                            <% if(editMark){
                                var arrEdit = editMark.split("$|$");
                            %>
                            <div class="editmark">[<%= __('edited_by')+arrEdit[0]+__('at')+arrEdit[1] %>]</div>
                            <% } %>
                        <% }else{ %>
                        <div class="hidden-note"><%= __('hidden_comment') %></div>
                        <% } %>
                    </div>
                </div>
                <% }
                }
                }
                %>
                <div class="article-bottom">
                    <div class="pages">
                        <%= __('comments') %> |
                        <%- strPageLinks %>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <% include ../sidebar %>
    <div class="clear"></div>
</div>

<% include ../pageFooter %>
